Skip to content

feat: add displayInViewport option to SelectPanel#7699

Merged
francinelucca merged 6 commits intomainfrom
chore/add-displayinviewport-option-to-selectpanel
Mar 25, 2026
Merged

feat: add displayInViewport option to SelectPanel#7699
francinelucca merged 6 commits intomainfrom
chore/add-displayinviewport-option-to-selectpanel

Conversation

@francinelucca
Copy link
Member

@francinelucca francinelucca commented Mar 25, 2026

Towards https://github.com/github/issues/issues/20714

Changelog

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Mar 25, 2026

🦋 Changeset detected

Latest commit: fd3aa8c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@francinelucca francinelucca changed the title feat: add displayInViewport option to SelectPanel for improved visibi… feat: add displayInViewport option to SelectPanel Mar 25, 2026
@github-actions github-actions bot added the staff Author is a staff member label Mar 25, 2026
@github-actions
Copy link
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Mar 25, 2026
@github-actions github-actions bot requested a deployment to storybook-preview-7699 March 25, 2026 00:54 Abandoned
@francinelucca francinelucca marked this pull request as ready for review March 25, 2026 01:01
@francinelucca francinelucca requested a review from a team as a code owner March 25, 2026 01:01
@francinelucca francinelucca changed the title feat: add displayInViewport option to SelectPanel [DO NOT MERGE] feat: add displayInViewport option to SelectPanel Mar 25, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new displayInViewport option to SelectPanel so consumers can opt into AnchoredOverlay’s “fit within viewport when possible” positioning behavior (useful for constrained layouts like dialogs).

Changes:

  • Extend SelectPanelProps to include displayInViewport and forward it to AnchoredOverlay.
  • Document the new prop in SelectPanel.docs.json.
  • Add a changeset for a minor @primer/react release noting the new prop.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/react/src/SelectPanel/SelectPanel.tsx Plumbs displayInViewport through SelectPanel’s public API into the underlying AnchoredOverlay.
packages/react/src/SelectPanel/SelectPanel.docs.json Adds documentation entry for the new displayInViewport prop.
.changeset/select-panel-display-in-viewport.md Declares a minor release for the new SelectPanel prop.

Comment on lines 876 to +880
pinPosition={!height}
className={classes.Overlay}
displayCloseButton={showXCloseIcon}
closeButtonProps={closeButtonProps}
displayInViewport={displayInViewport}
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New displayInViewport behavior is being surfaced on SelectPanel, but there’s no unit test asserting the prop is forwarded to AnchoredOverlay / getAnchoredPosition. Since SelectPanel already has extensive tests, please add a targeted test that renders SelectPanel with displayInViewport={true} and verifies the anchored positioning logic receives displayInViewport: true (e.g., by mocking @primer/behaviors like ActionMenu does).

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

@github-actions github-actions bot temporarily deployed to storybook-preview-7699 March 25, 2026 01:04 Inactive
@francinelucca francinelucca changed the title [DO NOT MERGE] feat: add displayInViewport option to SelectPanel feat: add displayInViewport option to SelectPanel Mar 25, 2026
Copy link
Contributor

Copilot AI commented Mar 25, 2026

@francinelucca I've opened a new pull request, #7702, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits March 25, 2026 12:02
…nel (#7702)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: francinelucca <40550942+francinelucca@users.noreply.github.com>
@github-actions github-actions bot requested a deployment to storybook-preview-7699 March 25, 2026 16:07 Abandoned
@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/16977

@francinelucca francinelucca added the integration-tests: skipped manually Changes in this PR do not require an integration test label Mar 25, 2026
@francinelucca francinelucca added this pull request to the merge queue Mar 25, 2026
@primer-integration
Copy link

Integration test results from github/github-ui:

Waiting  CI   Waiting
Passed  VRT   Passed
Waiting  Projects   Waiting

@primer-integration
Copy link

Integration test results from github/github-ui:

Waiting  CI   Waiting
Running  VRT   Running
Waiting  Projects   Waiting

Merged via the queue into main with commit 1505d9b Mar 25, 2026
65 of 67 checks passed
@francinelucca francinelucca deleted the chore/add-displayinviewport-option-to-selectpanel branch March 25, 2026 17:07
@primer primer bot mentioned this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm integration-tests: skipped manually Changes in this PR do not require an integration test staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants